<!-- page heading start-->
<div class="page-heading ng-scope">
	<ul class="breadcrumb">
		<li><a href="#"> 首页 </a></li>
		<li><a href="javascript:void(0);"> 导航管理 </a></li>
		<li class="active"> 导航分类</li>
	</ul>
</div>
<!-- page heading end-->

<div class="row">
    <div class="col-lg-12">
        <section class="panel">
              <header class="panel-heading"> 
           		<span ng-if="nc.id != null" > 编辑分类 </span>
            	<span ng-if="nc.id == null" > 添加分类 </span>
            </header>
            
            <div class="panel-body">
                <form class="form-horizontal" name="myForm" id="ncForm" >
                    <div class="form-group" ng-class="{'has-error':qaForm.ncName.$dirty && qaForm.ncName.$invalid}">
                        <label class="col-sm-2 control-label">分类名称</label>
						<div class="col-lg-10">
								<input type="text" ng-hide="true" ng-model="nc.id">
								<input type="text" ng-model="nc.nc_name" name="ncName" ng-maxlength="32" ng-minlength="2" class="form-control" ng-required="true" placeholder="请输入分类名称">
								<div ng-show="myForm.ncName.$dirty && myForm.ncName.$error.maxlength" class="alert alert-danger help-block">
									分类名称不能超过32个字符
								</div>
								<div ng-show="myForm.ncName.$dirty && myForm.ncName.$error.minlength" class="alert alert-danger help-block">
									分类名称不能少于2个字符
								</div>
                        </div>
                    </div>
                    
                    <div class="form-group">
                       	<label class="col-sm-2 control-label">放置位置</label>
	                      <div class="col-lg-10">
							<select ng-model="nc.nc_position" name="nc_position" class="form-control" ng-required="true"
								ng-options="x.d_key as x.d_value for x in positionList">
								<option value="">请选择放置位置</option>
							</select>
						</div>
                    </div>

					<div class="form-group" ng-class="{'has-error':myForm.adDescription.$dirty && myForm.adDescription.$invalid}">
						<label class="col-lg-2 col-sm-2 control-label">分类说明</label>
						<div class="col-lg-10">
							<textarea ck-editor class="form-control ckeditor" ng-model="nc.nc_description" name="adDescription" 
								ng-required="true" ng-maxlength="200"></textarea>
							<label for="inputKey" ng-show="myForm.adDescription.$dirty && myForm.adDescription.$error.maxlength" class="alert alert-danger help-block"> 
								最多能输入200字 
							</label>
						</div>
					</div>
                 
                    <div class="form-group" ng-class="{'has-error':myForm.ncSort.$dirty && myForm.ncSort.$invalid}">
                        <label for="inputTypeValue" class="col-lg-2 col-sm-2 control-label">排序</label>
                        <div class="col-lg-10">
                            <input type="number" class="form-control" id="inputSort" ng-model="nc.nc_sort"
								name="ncSort" ng-required="true" ng-maxlength="3" ng-pattern="/^[1-9]/" placeholder="请输入排序">
                            <label for="inputSort"
                            ng-show="myForm.ncSort.$dirty  && myForm.ncSort.$error.maxlength" class="alert alert-danger help-block">不能超过5位</label>
                            <label for="inputSort"
                            ng-show="myForm.ncSort.$dirty  && myForm.ncSort.$error.minlength" class="alert alert-danger help-block">至少输入1位</label>
                        </div>
                    </div>
                    
                   	<div class="form-group">
                   		<div class="col-lg-offset-2 col-lg-10">
	                       	<button type="submit" class="btn btn-danger"
								ng-click="nc.id != null ? update():save()" ng-disabled="myForm.$invalid">保存</button>
							<button type="button" class="btn btn-default" ng-click="back()">取消</button>
						</div>
                      </div>
                </form>
             </div>
        </section>
     </div>
</div>